package com.yan.music.action;

import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

//声明控制器类，表示响应数据为JSON字符串
@RestController
public class HelloController {
//    针对方法进行映射
    @RequestMapping("/hello")
    public String sayHello(String username) {
        if (username == null || username.trim().length() < 1) {
            username = "world";
        }
        return "Hello " + username + "!";
    }
}
